<% @companies.each do |company| %>
<h2><%= link_to_function(company.name, :class => 'fastForm_link') do |page|
	page.hide "remote_computer"
	page.hide "remote_room"
	page.hide "remote_network"
	page.hide "remote_operation"
	page.hide "remote_company"
 	page.replace_html 'show', :partial => 'companies/show', :locals => {:company => company}
	page.show "show"
end%>
</h2>
	<% if company.rooms.size == 0 %>
		<div class="room ui-state-disabled ui-corner ui-corner-all">
			<center>This company have no rooms yet.</center>
		</div>
	<% else %>
		<% company.rooms.each do |room| %>
			<% room_id = "room_#{room.id}" %>
			<% room_capacity_id = "room_capacity_#{room.id}" %>
			<!-- If the room is a stock room-->
			<%if room.stock %>
				<b>Stock : </b><%= link_to_function(room.code) do |page|
					page.hide "remote_computer"
					page.hide "remote_room"
					page.hide "remote_network"
					page.hide "remote_operation"
					page.hide "remote_company"
			     	page.replace_html 'show', :partial => 'rooms/show', :locals => {:room => room}
					page.show "show"
				end%>
				<span id=<%= room_capacity_id %>><%= render :partial => 'supervisions/capacity_room', :locals => {:room => room}%></span>
				<div id=<%= room_id %> class="room ui-state-highlight ui-corner ui-corner-all">
			<%else%>
				<b>Room : </b><%= link_to_function(room.code, :class => 'fastForm_link') do |page|
					page.hide "remote_computer"
					page.hide "remote_room"
					page.hide "remote_network"
					page.hide "remote_operation"
					page.hide "remote_company"
			     	page.replace_html 'show', :partial => 'rooms/show', :locals => {:room => room}
					page.show "show"
				end%>
				<span id=<%= room_capacity_id %>><%= render :partial => 'supervisions/capacity_room', :locals => {:room => room}%></span>
				<div id=<%= room_id %> class="room ui-state-default ui-corner ui-corner-all">
			<%end%>
			<% room.computers.each do |@computer| %>
				<%= render :partial => 'supervisions/computer_in_room', :locals => {:computer => @computer}%>
			<%end%>
			</div>
			<%= drop_receiving_element('trash',
			  :accept => "computerList",
			  :with   => "'computer=' + (element.id.split('_').last()) + '&room=#{room.id.to_s}'",
			  :url    => {:controller => :supervisions, :action=>:trash_computer}
			)%>
			<%= drop_receiving_element(room_id,
			  :accept => "computerList",
			  :with   => "'computer=' + (element.id.split('_').last()) + '&room=#{room.id.to_s}'",
			  :url    => {:controller => :supervisions, :action=>:move_computer}
			)%>
		<%end%>
	<% end %>
<%end%>